package com.bamboocloud.im.dao;

import com.bamboocloud.im.entity.Dept;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Auther xuwen
 * @Date 2021/12/9 10:14
 * @Version 1.0
 */

@Repository
public interface DeptDao {
    @Insert("insert into dept(dname,db_source) values (#{dname},DATABASE())")
    public boolean addDept(Dept dept);
    @Select("select * from dept where deptno= #{deptno}")
    public Dept selectDeptById(Long id);
    @Select("select * from dept ")
    public List<Dept> selectAllDept();
    @Delete("delete from dept where deptno= #{deptno}")
    public boolean deleteDeptById(Long id);
    @Update("update dept set dname=#{dname} where deptno= #{deptno}")
    public Dept UpdateDept(Dept dept);
}
